package com.foreknow.Test;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Example2 {
    public static void main(String[] args) {
        String[] strings = new String[]{"黑龙江省","浙江省","江西省","广东省","福建省"};
        String[] strings1 = new String[]{"哈尔滨","杭州","南昌","广州","福州"};
        Map<String,String> map = new HashMap<>();
        if (strings.length == strings1.length){
            for (int i = 0;i < strings.length;i++){
                map.put(strings[i],strings1[i]);
            }
        }
        Set<Map.Entry<String,String>> set = map.entrySet();
        Iterator<Map.Entry<String,String>> it = set.iterator();
        while (it.hasNext()){
            Map.Entry<String,String> m = it.next();
            System.out.println(m.getKey()+"---"+m.getValue());
        }
    }
}
